package com.bo.dao.user;

import com.bo.pojo.Role;
import com.bo.pojo.User;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

public interface UserDao {

    //得到登录的用户
    public User getLoginUser(Connection connection, String userCode, String userPassword) throws SQLException;

    //修改密码
    public int updatePwd(Connection connection, int id, String password) throws SQLException;

    //根据用户名或角色查询用户总数
    public int getUserCount(Connection connection, String username, int userRole) throws SQLException;

    //根据用户名或角色获取用户列表
    public List<User> getUserList(Connection connection, String userName, int userRole, int currentPageNo, int pageSize)throws SQLException;

    //添加用户
    public int addUser(Connection connection, User user) throws SQLException;

    //删除用户
    public int deleteUserById(Connection connection, Integer delId)throws Exception;

    //根据id查看用户信息
    public User getUserById(Connection connection, String id)throws Exception;

    //修改用户信息
    public int modify(Connection connection, User user)throws Exception;
}
